//
// Created by yangdian on 2020/5/18.
//

#ifndef XPLAY_XLOG_H
#define XPLAY_XLOG_H


class XLog {

};

#ifdef ANDROID
#include <string>
#include <android/log.h>
#define LOG_TAG "XPlay_XPlay"
#define XLOG(level, format, ...) \
do\
{ \
    std::string format_detailed = std::string("file:%s, function:%s, line:%d. ") + std::string(format);\
    __android_log_print(level, LOG_TAG, format_detailed.c_str(), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
} while(0)
#define XLOGD(format, ...) XLOG(ANDROID_LOG_DEBUG, format, ##__VA_ARGS__)
#define XLOGI(format, ...) XLOG(ANDROID_LOG_INFO, format, ##__VA_ARGS__)
#define XLOGE(format, ...) XLOG(ANDROID_LOG_ERROR, format, ##__VA_ARGS__)
#else
#define XLOGD(...) printf("XPlay", __VA_ARGS__)
#define XLOGI(...) printf("XPlay", __VA_ARGS__)
#define XLOGE(...) printf("XPlay", __VA_ARGS__)
#endif




#endif //XPLAY_XLOG_H
